package com.gqz.equip.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gqz.common.core.domain.R;
import com.gqz.common.core.domain.RequestForm;
import com.gqz.equip.api.EnWzKfglApi;
import com.gqz.equip.service.IEnWzKfglService;
import com.gqz.equip.vo.EnWzKfglVo;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 库房信息表 Controller
 *
 * @Version 1.0
 * @Author input you name
 */
@RestController
public class EnWzKfglController implements EnWzKfglApi {

    @Autowired
    private IEnWzKfglService service;

    @Override
    public R<List<EnWzKfglVo>> getById(String id) {
        return R.ok(service.getById(id));
    }

    @Override
    public R<Page<EnWzKfglVo>> page(@Valid RequestForm<EnWzKfglVo> requestForm) {
        return R.ok(service.page(requestForm));
    }

    @Override
    public R<Long> count(@Valid RequestForm<EnWzKfglVo> requestForm) {
        return R.ok(service.count(requestForm));
    }

    @Override
    public R<Integer> insert(List<EnWzKfglVo> vos) {
        return R.ok(service.insert(vos));
    }

    @Override
    public R<Integer> update(@Valid List<EnWzKfglVo> vos) {
        return R.ok(service.update(vos));
    }

    @Override
    public R<Boolean> delete(@Valid List<String> ids) {
        return R.ok(service.removeBatchByIds(ids));
    }

    @Override
    public R<List<EnWzKfglVo>> getByDwbm(String dwbm) {
        return R.ok(service.getByDwbm(dwbm));
    }

    @Override
    public R<List<EnWzKfglVo>> getKfList() {
        return R.ok(service.getKfList());
    }

}
